#include <stdio.h>
int main()
{
    int n;
    scanf("%d",&n);
    if(n%3==0&&n%5==0&&n%7==0)
        printf("All\n");
    if((n%3==0&&n%5==0))
        printf("3 and 5\n");
    if((n%3==0&&n%7==0))
        printf("3 and 7\n");
    if((n%5==0&&n%7==0))
        printf("5 and 7\n");
    if(n%3==0)
        printf("3\n");
    if(n%5==0)
        printf("5\n");
    if(n%7==0)
        printf("7\n");
    if(n%3!=0&&n%5!=0&&n%7!=0)
        printf("None\n");
    return 0;
}
